//得到a标签的值
var a = document.getElementsByClassName("sb");
var a = document.getElementsByClassName("aa");
//得到显示块的内容
var body = document.getElementById("body");
var li = body.getElementsByTagName("li");
//给每个li标签赋下标
for(var b=0;b<li.length;b++){
    li[b].index = b;
}
for(var i=0;i<a.length;i++) {
    a[i].index = i;
    a[i].onclick = function () {
        for (var j = 0; j < li.length; j++) {
            if (this.index == j) {
                a[j].style.backgroundColor = " rgba(118, 121, 210, 0.5)";
                li[j].style.display = "block";
            } else {
                a[j].style.backgroundColor = "rgba(0,0,0,0.15)";
                li[j].style.display = "none";
            }
        }
    };
}
